'Read the frame corner posiions and move command
'!TITLE "<Title>"
PROGRAM Pro17

COM_ENCOM #1    
TAKEARM  

DEFINT No_pts = 9, P_st = 20                      
DEFINT Ii2, int_k = P_st        
DEFSTR Q


MOVE P,J0                 
FLUSH #1                   
PRINT #1,"S"            

'----------------------------------------------------------------------
'----------------------------------------------------------------------
'Read Number of Critical Corner Points

FLUSH #1                             
INPUT #1, I[10]

No_pts = I[10] 

DO
  PRINT #1,"S"
  FLUSH #1
  INPUT #1,Q,WTIME=20   'change and see the effect of WTIME=100
  IF Q="q" THEN EXIT DO	
LOOP

LET Q=" "

'----------------------------------------------------------------------
'----------------------------------------------------------------------
'Read Corner Position points and Speeed and then Save on P-Variable

*L2:

FLUSH #1                             
INPUT #1,P[int_k], I[int_k]                               

DO
  PRINT #1,"S"
  FLUSH #1
  INPUT #1,Q,WTIME=20   'change and see the effect of WTIME=100
  IF Q="q" THEN EXIT DO
LOOP

LET Q=" "

IF int_k = (P_st + No_pts - 1) THEN *L1

int_k = int_k + 1

GOTO *L2  


'----------------------------------------------------------------------
'----------------------------------------------------------------------
'Move command from P-Variable saved above

*L1:

EXTSPEED 30
APPROACH P, P[P_st] , @E 100, S=60

DELAY 2000       'Delay before the next Frame being painted or while the frame rotates

FOR Ii2 = P_st TO (P_st + No_Pts - 1)

  EXTSPEED I[Ii2]  
  MOVE L,@5 P[Ii2], S=100

NEXT

GOTO *L1

END
